<%@include file="cabecera.jsp"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@page import="javaroke.modelo.Local,javaroke.modelo.Administrador,javaroke.negocio.GestionAdministrador,java.util.*"%>
<%@page import="javaroke.negocio.GestionLocal"%>

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang ="en">

	


<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Registro de Local</title>
<style type="text/css">
.blanco {
	color: #FFF;
	text-align: right;
	font-weight: bold;
}
.letra {
	font-family: Calibri;
	font-size: 12px;
}

.anaranjado {
	color: #FF8000;
	text-align: right;
	font-weight: bold;
	font-size:9px
}
.rojo {
	color: #F00;
}
</style>

<meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
  
    <title>Bootstrap, from Twitter</title>

    <script src="js/jquery-1.10.2.js"></script>
    <script src="js/jquery-ui-1.10.3.js"></script>
    <script src="js/bootstrap.js"></script>
    
    <!-- Le styles -->
    <link href="css/bootstrap.css" rel="stylesheet">    
    <link href="css/bootstrap-responsive.css" rel="stylesheet">
    <link href="css/bootswatch.css" rel="stylesheet">
    <link href="css/jquery-ui-1.10.3.css" rel="stylesheet">
  

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->




<script language="javascript" type="text/javascript">
    //*** Este Codigo permite Validar que sea un campo Numerico
    
    function ValidaDatos(){
         //** Nombre de Local        
         if ( document.f2.txtNombreLocal.value == ""){
            alert('Ingrese Nombre de Local');
            return false;
         }          
         
         if ( document.f2.txtDireccion.value == ""){
                 alert('Ingrese la Direccion de Local');
                 return false;
          }
         
         if ( document.f2.txtTelefono.value == ""){
                 alert('Ingrese Telefono de Local');
                 return false;
          }
                  
         if ( document.f2.txtEmailE.value == "" ){
                alert('Direccion de Correo errada');
                return false;
         }
        	 
          if ( document.f2.txtEmailS.value == "" ){
                 alert('Direccion de Correo errada');
                 return false;
              }
         
          if ( document.f2.txtComentario.value.length == 0 ){
              alert('No se ha registrado comentarios');
              return false;
           } 
                  
         return true;
       }
    
</script>

</head>
<body class = "preview">

    <div class="container-fluid">
    
      	<div class="span10">
      	<p><strong><h4> Mantenimiento de Local &gt; Registrar Local</h4> </strong></p>
      	     <form class="form-horizontal "  name="f2" method="post" action="RegistrarLocalServlet" onsubmit ="ValidaDatos()">
      	         <fieldset>
      	            
      	             <div class="control-group">
				         <label class="control-label" for="txtNombreLocal">Nombre de Local:</label>
				         <div class="controls">
					         <input type="text" class="input-medium" name="txtNombreLocal" id="txtNombreLocal" >
					     </div>
                     </div>
                     
                     <div class="control-group">
				         <label class="control-label" for="txtDireccion">Direccion:</label>
				         <div class="controls">
					         <input type="text" class="input-large" name="txtDireccion" id="txtDireccion" >
					     </div>
                     </div>
                     
                     <div class="control-group">
				         <label class="control-label" for="txtTelefono">Telefono:</label>
				         <div class="controls">
					         <input type="text" class="input-small" name="txtTelefono" id="txtTelefono" >
					     </div>
                     </div>
                     
                     
                     <div class="control-group">
                          <label class="control-label" for="txtEmail">Correo:</label>
                          <div class="controls">
                           <div class="input-prepend">
                              <input class="span4" name= "txtEmailE" id="txtEmailE" type="text"> 
                              <span class="add-on">@</span>
                              <input class="span2" name= "txtEmailS" id="txtEmailS" type="text">
                           </div>                
                          </div>
                     </div>
              
                     <div class="control-group">
                          <label class="control-label" for="txtComentario">Descripcion:</label>
                          <div class="controls">
                          <div class="input-prepend">
                               <textarea name="txtComentario" id="txtComentario rows= 2 cols=60"  >  </textarea>
                          </div>                
                          </div>
                     </div>
               
                     
                     <div class="control-group">
                          <label class="control-label" for="LstAdministrador">Administrador</label>
                          <div class="controls">
                             <%  GestionAdministrador Adminis = new GestionAdministrador();
                                 Collection<Administrador> todos = Adminis.listar();	          
		                         request.setAttribute("regAdministrador",todos);
		                      %>
                               <select id="LstAdministrador" name = "LstAdministrador" >
                                 <%       String tipo = " ";
					                     for(Administrador c:todos){
			   			                   if(!tipo.equals(c.getPersona().getPaterno())){
				 			                 out.println("<option value=" +c.getIdadministrador()+">"+c.getPersona().getPaterno()+" "+c.getPersona().getMaterno()+" "+c.getPersona().getNombres()+"</option>");
						                   }
					  	                 tipo = c.getPersona().getPaterno();				 
					                     }
					                     %>
				                             
                               </select>
                          </div>
                     </div>
                     
                     <div class="form-actions">
				         <button type="submit" class="btn btn-small btn-primary" name="btnGuardar" id="btnGuardar" >Enviar</button>
	    			     <button type="reset"  class="btn btn-small" name="btnCancelar" id="btnCancelar"  onclick="window.location = 'Locales.jsp'"   >Cancelar  </button>            
                     </div>
                     
      	         </fieldset>
      	     </form>
      	     <%@include file="pie.jsp"%>
      	</div> 
    </div>

	
</body>
</html>